home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / util / shell / AXshDemo131.lha / InstallDisk.lha / man / newaux-handler.man < prev    next >
Encoding:
Text File  |  1994-03-10  |  6.1 KB  |  184 lines

  1.  
  2.  
  3. NEWAUX-handler        System handler             4-Feb-94
  4.  
  5.  
  6.  
  7. Newaux-handler 1.33  4-Feb-94    By Pasi Ojala    albert@cs.tut.fi
  8. -----------------------------    the original aux-handler by Stewe Drew
  9.  
  10. This handler can be used with any serial device and unit. Now you can
  11. also handle several simultaneous serial connections at the same time
  12. with only one invokation of the handler. (If it doesn't work, let me know.)
  13.  
  14.  
  15. MOUNTLIST
  16.     An example mountlist entry for pre-2.1 systems:
  17.  
  18.     NEWAUX:
  19.         Handler = AXsh:bin/NEWAux-Handler
  20.         Stacksize = 2000
  21.         Priority = 5
  22.         GlobVec = 1
  23.     #
  24.  
  25.     For after-2.1 systems you use file Devs:DosDrivers/NEWAUX:
  26.  
  27.         Handler = L:NEWAux-Handler
  28.         Stacksize = 2000
  29.         Priority = 5
  30.         GlobVec = 1
  31.  
  32.     If you have your AXsh system assigned somewhere instead of using
  33.     a disk labeled AXsh:, you should copy the handler file to L: and
  34.     change the mountlist entry accordingly.
  35.  
  36.     Newaux-handler uses about 560 bytes of stack. The rest is
  37.     just to be sure about the library routines. You can try to
  38.     reduce the stack to 1000 bytes or less if you REALLY REALLY
  39.     are short of memory.
  40.  
  41.  
  42. CONTROLLING
  43.     The handler can be controlled and configured with the filename
  44.     part of the 'filename'.
  45.  
  46.         <handler-name>:[<device-name>/<unit>/<optional>]]
  47.  
  48.     The handler name can be any legal name, for example the default
  49.     newaux. By default the handler uses serial.device unit 0, in raw-mode
  50.     with 7WIRE (CTS/RTS) handshaking and in exclusive mode. NEWAUX:
  51.     normally uses the speed defined in serial preferences, whichever
  52.     the device defaults to. Now it is also possible to set the speed
  53.     with the speed-entry.
  54.  
  55.     If any of the optional parameters need to be changed, you also need
  56.     to specify the device name and unit number. The optional parameters
  57.     include:
  58.  
  59.     Default    Alternative    Function
  60.     -------    -----------    --------
  61.     raw            Select raw mode, no echo
  62.         con        Select cooked mode, echo chars
  63.                 [Most programs handle changing from/to
  64.                  raw/cooked mode themselves.]
  65.  
  66.     exclusive        Open serial in exclusive mode
  67.         shared        Open serial in shared mode
  68.  
  69.     7wire            Select hardware flow control (cts/rts)
  70.         noflow        Select no flow control
  71.  
  72.     speed<speed>        Set the baud rate, otherwise prefs value used
  73.  
  74.     checkcd            Send Break signal & EOF if carrier is lost
  75.                 Always use this in 'normal' AXsh operation.
  76.  
  77.     useodu            Uses owndevunit.library to lock the serial
  78.                 [Will have no effect if OwnDevUnit.library
  79.                  is not available.]
  80.  
  81.     An example to use with UUCP getty (with no handshake):
  82.  
  83.     newshell newaux:serial.device/0/noflow/shared/checkcd/useodu \
  84.      from axsh:etc/remote-startup
  85.  
  86.  
  87.  
  88. SPECIAL 'FILENAMES'
  89.     The handler also has two special functions (hacks?) :
  90.  
  91.     newaux:tobuf<n>/<text>
  92.             will insert the text directly to the <n>th receive
  93.             buffer. <n> is the connection number, that can not
  94.             be obtained anywhere. You just have to guess it.
  95.             The first connection is channel 0.
  96.  
  97.     newaux:break<channel>
  98.             will send SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_D to the
  99.             process reading the channel. The channel number is
  100.             obtained by educated guess..
  101.  
  102.     newaux:led<mask>
  103.             will change the state of the power led for each
  104.             event in the mask.
  105.  
  106.     The mask values are:
  107.         #define LED_SYNCREAD        1
  108.         #define LED_ASYNCREAD        2
  109.         #define LED_SYNCWRITE        4
  110.         #define LED_ASYNCWRITE        8
  111.         #define LED_QUERY        16
  112.         #define LED_MESSAGE        32
  113.     Synchronous reads are performed if there already is something in
  114.     the serial buffer (in raw mode the data also needs to be requested).
  115.     Synchronous writes are bad because during them other connections
  116.     can't be serviced. They should only happen when the output buffer
  117.     overflows (in console-mode).
  118.  
  119.     Asynchronous write means that the data is sent to the serial device
  120.     and during the time it takes to send it the handler is free to
  121.     service other connections or read requests. Asynchronous reads are
  122.     started in console mode (so that line editing is possible) and
  123.     in raw mode when there is no characters in the buffer(s) and a
  124.     program wants to Read() (or WaitForChar()). Read is returned when
  125.     a character is received or carrier is dropped, WaitForChar also if
  126.     the specified timeout is reached before any characters are received.
  127.  
  128.     Queries are performed to find out whether the carrier has dropped
  129.     or not. LED_MESSAGE lights the led for the duration of the handling
  130.     of each AmigaDOS packet.
  131.  
  132.     Trying to open these 'files' will always fail, but the function will
  133.     be performed anyway (if the handler is mounted and functioning).
  134.         e.g.
  135.             echo >newaux:led8
  136.  
  137.  
  138. CARRIER CHECKING
  139.     If the carrier checking is enabled (/checkcd) and the carrier is
  140.     lost, all pending Read()'s or WaitForChar()'s are returned
  141.     immediately. Read() returns 0 (zero) meaning EOF (end of input
  142.     actually), WaitForChar() returns TRUE, so that your next Read()
  143.     can return EOF. In addition, the Read()'ing process is signaled
  144.     with SIGBREAKF_CTRL_C.
  145.  
  146.  
  147. HANDLER MODES (SetMode(), ACTION_SCREENMODE)
  148.     Newaux-handler supports normal 'console' ('cooked') mode and
  149.     'raw' mode.
  150.  
  151.     SetMode(0)    put the handler into console (line-)buffered mode
  152.  
  153.     SetMode(1)
  154.     SetMode(-1)     put the handler into raw mode, where line-feeds (\n)
  155.             are converted to LF/CR sequences (\n\r)
  156.             Also, CSI (0x9b) is converted to the more familiar
  157.             ANSI/VT100 version, ESC[ (0x1b + '[').
  158.  
  159.     SetMode(3)    is for 'passthrough' mode, no codes are translated
  160.             This is well-suited for XPR transfers (see XPR).
  161.  
  162.     ^C and ^D cause corresponding signals to be sent to the original
  163.     opener in all modes AFTER THE FIRST SetMode() CALL. This makes
  164.     it impossible to break e.g. the newshell command/script that is
  165.     used to start the program.
  166.  
  167.     When someone tells me the arguments for the ACTION_CHANGE_SIGNAL
  168.     DOS-packet, I can make it work 'correctly' so that the it is
  169.     possible to 'redirect' the signals to any process that wants to get
  170.     them.
  171.  
  172.  
  173. Some notes:
  174.     The raw mode input is greatly enhanced compared to axaux-handler
  175.     and this affects mostly    uploads to the system. The cps has gone up
  176.     from 900 to the    full 1090 that my modem can achieve (LhA packets)
  177.     and the system load has decreased considerably. I also tested it
  178.     with a Unix-executable file and got something like 1870 cps for a
  179.     131-kilobyte-file.
  180.  
  181.     Just like before: the more system load, the less overhead the
  182.     handler will add ..
  183.  
  184.